package com.boang.controller;

import com.boang.resp.Result;
import com.boang.service.OssService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/*
  @author: 13813
  @date: 2024/9/16 13:53
*/
@RestController
public class SonarController {

    @Autowired
    private OssService ossService;

    @Operation(summary = "上传文件")
    @PostMapping("/upload")
    public Result<String> upload(@RequestPart MultipartFile file) throws Exception {
        return Result.ok(ossService.uploadFile(file));
    }
}
